<div class="right_side_operate_area">
	<div class="right_side_title left">
		<h2><?php echo $user['User']['username']; ?></h2>
	</div>
	<div class="right item_add_btn">
		<?php 
			//$userid=$form->value('User.id');
			$userid=$user['User']['id'];
    		echo $html->link(__("Cancel",true),"/users/view/".$userid);
    	?>
	</div>
	<div class="clear"></div>
</div>
<div class="right_side_scollbar">
	<div class="detail_info_panel">
		<?php 
			echo $form->create('User', array('action' => 'editusermessage','type'=> 'post','id' => 'form','name' => 'form','onsubmit' => 'return checkpwd()') );
		?>
		<div class="details_item_line">
			<div class="details_item">
			    <div class="form_left_title left"><?php echo '用户名'?>：</div>
			    <div class="form_right_e_input left"><?php echo $form->text('User.username');?></div>
			</div>
		</div>
		<div class="details_item_line">
			<div class="details_item">
			    <div class="form_left_title left"><?php echo "密码" ?>：</div>
			    <div class="form_right_e_input left"><?php echo $form->password('User.password',array("autocomplete"=>"off"));?></div>
			    <div id='passwordmessage' class="error_message"></div>
			</div>
		</div>
		<div class="details_item_line">
			<div class="details_item">
			    <div class="form_left_title left"><?php __("Retype Password")?>：</div>
			    <div class="form_right_e_input left"><?php echo $form->password('User.Retype Password');?></div>
			    <div id='passwordmessage1' class="error_message"></div>
			</div>
		</div>
		<?php echo $form->input('id', array('type'=>'hidden','value'=>$user['User']['id'])); ?>
		<div class="details_item_line">
			<div class="details_item">
				<div class="form_left_title left"></div>
			    <div class="form_add_submit left">
			    	<?php echo $form->submit(__('Save',true), array("id"=>"edituser","name"=>"submit","class"=>"buttom","div"=>false));  ?>
					<?php  //echo $form->hidden('User.id'); ?>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
function checkpwd(){
	  if($("#UserUsername").val().trim() == '' && $("#UserPassword").val().trim() == '' && $("#UserRetypePassword").val().trim() == ''){
	  		showmessage("请输入修改信息！","F");
	  		return false;
	  }	
	  if($("#UserPassword").val()){
		   if($("#UserPassword").val().length < 6){
		    $("#passwordmessage").html('你的设置的密码至少为6位');
		  		return false;
		   }
		  if($("#UserPassword").val().length > 32){
		  	$("#passwordmessage").html('您的密码不能超过32位');
		  		return false;
		   }
	   }
	   if($("#UserRetypePassword").val().trim() == ''){
	   	 $("#passwordmessage1").html('请输入确认密码');
		  		return false;
	   }
	   if($("#UserPassword").val() && $("#UserPassword").val().trim()){
		   if($("#UserRetypePassword").val().trim() != $("#UserPassword").val().trim()){
		 		 $("#passwordmessage1").html('输入的密码不匹配！');
		  		return false;
		  }
	  }
	  return true;
}
</script>